﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VideoBlog.Web.Models;

namespace VideoBlog.Web.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            IndexViewModel model = new IndexViewModel();
            return View(model);
        }

        public ActionResult About()
        {
            return View();
        }

        public ActionResult Channel(string channelName)
        {
            IndexViewModel model = new IndexViewModel(channelName);
            return View("Index",model);
        }

        // We come to this action when we select either a video to watch, or
        // we select a playlist, in which case we set the videoID to be the first video in the playlist
        public ActionResult Watch(int? playlistid, int? videoid, string descriptor, string playlistdescriptor)
        {
            IndexViewModel model = new IndexViewModel(videoid.Value);
            return View(model);
        }
    }
}
